(0) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
active(p(X)) → p(active(X))
active(s(X)) → s(active(X))
active(leq(X1, X2)) → leq(active(X1), X2)
active(leq(X1, X2)) → leq(X1, active(X2))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(diff(X1, X2)) → diff(active(X1), X2)
active(diff(X1, X2)) → diff(X1, active(X2))
p(mark(X)) → mark(p(X))
s(mark(X)) → mark(s(X))
leq(mark(X1), X2) → mark(leq(X1, X2))
leq(X1, mark(X2)) → mark(leq(X1, X2))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
diff(mark(X1), X2) → mark(diff(X1, X2))
diff(X1, mark(X2)) → mark(diff(X1, X2))
proper(p(X)) → p(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(leq(X1, X2)) → leq(proper(X1), proper(X2))
proper(true) → ok(true)
proper(false) → ok(false)
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(diff(X1, X2)) → diff(proper(X1), proper(X2))
p(ok(X)) → ok(p(X))
s(ok(X)) → ok(s(X))
leq(ok(X1), ok(X2)) → ok(leq(X1, X2))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
diff(ok(X1), ok(X2)) → ok(diff(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))
Rewrite Strategy: INNERMOST
(1) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)
The following defined symbols can occur below the 0th argument of top: proper, active
The following defined symbols can occur below the 0th argument of proper: proper, active
The following defined symbols can occur below the 0th argument of active: proper, active
Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
active(p(X)) → p(active(X))
active(s(X)) → s(active(X))
active(leq(X1, X2)) → leq(active(X1), X2)
active(leq(X1, X2)) → leq(X1, active(X2))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(diff(X1, X2)) → diff(active(X1), X2)
active(diff(X1, X2)) → diff(X1, active(X2))
proper(p(X)) → p(proper(X))
proper(s(X)) → s(proper(X))
proper(leq(X1, X2)) → leq(proper(X1), proper(X2))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(diff(X1, X2)) → diff(proper(X1), proper(X2))
(2) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
p(mark(X)) → mark(p(X))
leq(ok(X1), ok(X2)) → ok(leq(X1, X2))
proper(true) → ok(true)
top(ok(X)) → top(active(X))
p(ok(X)) → ok(p(X))
leq(X1, mark(X2)) → mark(leq(X1, X2))
diff(mark(X1), X2) → mark(diff(X1, X2))
s(ok(X)) → ok(s(X))
leq(mark(X1), X2) → mark(leq(X1, X2))
s(mark(X)) → mark(s(X))
proper(false) → ok(false)
proper(0) → ok(0)
diff(ok(X1), ok(X2)) → ok(diff(X1, X2))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
diff(X1, mark(X2)) → mark(diff(X1, X2))
top(mark(X)) → top(proper(X))
Rewrite Strategy: INNERMOST
(3) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)
A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 2.
The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1, 2, 3, 4, 5, 6, 7]
transitions:
mark0(0) → 0
ok0(0) → 0
true0() → 0
active0(0) → 0
false0() → 0
00() → 0
p0(0) → 1
leq0(0, 0) → 2
proper0(0) → 3
top0(0) → 4
diff0(0, 0) → 5
s0(0) → 6
if0(0, 0, 0) → 7
p1(0) → 8
mark1(8) → 1
leq1(0, 0) → 9
ok1(9) → 2
true1() → 10
ok1(10) → 3
active1(0) → 11
top1(11) → 4
p1(0) → 12
ok1(12) → 1
leq1(0, 0) → 13
mark1(13) → 2
diff1(0, 0) → 14
mark1(14) → 5
s1(0) → 15
ok1(15) → 6
s1(0) → 16
mark1(16) → 6
false1() → 17
ok1(17) → 3
01() → 18
ok1(18) → 3
diff1(0, 0) → 19
ok1(19) → 5
if1(0, 0, 0) → 20
mark1(20) → 7
if1(0, 0, 0) → 21
ok1(21) → 7
proper1(0) → 22
top1(22) → 4
mark1(8) → 8
mark1(8) → 12
ok1(9) → 9
ok1(9) → 13
ok1(10) → 22
ok1(12) → 8
ok1(12) → 12
mark1(13) → 9
mark1(13) → 13
mark1(14) → 14
mark1(14) → 19
ok1(15) → 15
ok1(15) → 16
mark1(16) → 15
mark1(16) → 16
ok1(17) → 22
ok1(18) → 22
ok1(19) → 14
ok1(19) → 19
mark1(20) → 20
mark1(20) → 21
ok1(21) → 20
ok1(21) → 21
active2(10) → 23
top2(23) → 4
active2(17) → 23
active2(18) → 23
(4) BOUNDS(1, n^1)